package com.eshore.norm.pattern.builder.demo2;

/**
 * 产品-房子
 *
 * @author: v-chenjl62
 * @date: 2024/2/1 9:25
 */
public class House {

    private  House(Builder builder){
        this.basic=builder.basic;
        this.walls=builder.walls;
        this.roofed=builder.roofed;
    }

    private String basic;
    private String walls;
    private String roofed;

    @Override
    public String toString() {
        return "House{" +
                "basic='" + basic + '\'' +
                ", walls='" + walls + '\'' +
                ", roofed='" + roofed + '\'' +
                '}';
    }

    public static final class Builder{
        private String basic;
        private String walls;
        private String roofed;

        public Builder setBasic(String basic) {
            this.basic = basic;
            return this;
        }

        public Builder setWalls(String walls) {
            this.walls = walls;
            return this;
        }

        public Builder setRoofed(String roofed) {
            this.roofed = roofed;
            return this;
        }

        public House build(){
            return new House(this);
        }
    }


}
